package com.compass.mobile.ui.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.FragmentTransaction
import com.compass.mobile.R
import com.compass.mobile.databinding.ActivityHomePageBinding
import com.compass.mobile.framework.base.BaseVBActivity
import com.compass.mobile.framework.constant.KEY_CLASSIFY_ID
import com.compass.mobile.framework.constant.KEY_ORDER_ID
import com.compass.mobile.ui.fragment.CaseDetailsFragment

/**
 * Description： 护理详情
 * Date:2024/6/3 22:06
 */
class CaseDetailsActivity : BaseVBActivity<ActivityHomePageBinding>() {

    companion object {
        fun start(context: Context, id: String, classifyId: String) {
            val intent = Intent(context, CaseDetailsActivity::class.java)
            intent.putExtra(KEY_ORDER_ID, id)
            intent.putExtra(KEY_CLASSIFY_ID, classifyId)
            context.startActivity(intent)
        }
    }

    private var orderId: String? = null
    private var classifyId: String? = null
    private lateinit var caseDetailsFragment: CaseDetailsFragment
    override fun initView(savedInstanceState: Bundle?) {
        orderId = intent.getStringExtra(KEY_ORDER_ID)
        classifyId = intent.getStringExtra(KEY_CLASSIFY_ID)

        caseDetailsFragment =CaseDetailsFragment()
        val bundle = Bundle()
        bundle.putString(KEY_ORDER_ID, orderId)
        bundle.putString(KEY_CLASSIFY_ID, classifyId)
        caseDetailsFragment.arguments = bundle

        val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction()
        fragmentTransaction.replace(R.id.fragmentContainer, caseDetailsFragment)
        fragmentTransaction.commit()

    }
}
